package com.tab.demo;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;

public class TabDemo extends TabActivity {
	
	private TabHost tb = null;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        tb = this.getTabHost();
        
        LayoutInflater li = LayoutInflater.from(this);
        li.inflate(R.layout.main, tb.getTabContentView(), true);

        
        Log.d("debug :", tb.toString());
        
        Intent it = new Intent();
		it.setClass(TabDemo.this, Act1.class);
		
        Intent it2 = new Intent();
		it2.setClass(TabDemo.this, Act2.class);
        
        tb.addTab(tb.newTabSpec("--").setIndicator("sdsds").setContent(it)) ;
        tb.addTab(tb.newTabSpec("--").setIndicator("1111").setContent(it2)) ;
        
        tb.setOnTabChangedListener(new OnTabChangeListener(){

			@Override
			public void onTabChanged(String tabId) {

			}
        	
        });
        
        //tb.setCurrentTab(0);
    }
    
    
}